/**
 * 
 */
package com.ar.myshares.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import com.ar.myshares.daos.OperationDAO;
import com.ar.myshares.model.Operation;

/**
 * @author mac
 *
 */
public class OperationServiceImpl implements OperationService {

	@Autowired
	private OperationDAO operationDAO;

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.ar.myshares.services.OperationService#getOperation(long)
	 */
	@Override
	@Transactional(readOnly = true)
	public Operation getOperation(long id) {
		return operationDAO.getOperation(id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.ar.myshares.services.OperationService#getAllOperations()
	 */
	@Override
	@Transactional(readOnly = true)
	public List<Operation> getAllOperations() {
		return operationDAO.getAllOperations();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.ar.myshares.services.OperationService#saveOperation(com.ar.myshares
	 * .model.Operation)
	 */
	@Override
	@Transactional
	public Operation saveOperation(Operation operation) {
		return operationDAO.saveOperation(operation);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.ar.myshares.services.OperationService#removeOperation(com.ar.myshares
	 * .model.Operation)
	 */
	@Override
	@Transactional
	public void removeOperation(Operation operation) {
		operationDAO.removeOperation(operation);
	}

}
